package com.ziiwee.reduce.describe.models;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ziiwee.reduce.describe.FieldDescribe;
import com.ziiwee.reduce.describe.HandlerDescribe;
import com.ziiwee.reduce.describe.HttpRequestParameterType;
import org.springframework.core.ResolvableType;

import java.util.List;
import java.util.Map;

/**
 * @author ziiwee
 * @data 2020/8/12
 */
public class HandlerDescribeModel implements HandlerDescribe {

    private String name;
    @JsonSerialize(using = ResolvableTypeSerializer.class)
    private ResolvableType type;
    private String label;
    private String description;

    public List<String> methods;
    public List<String> patterns;
    public Map<HttpRequestParameterType, List<FieldDescribe>> parameters;
    public String id;

    public HandlerDescribeModel(String name, ResolvableType type, String label, String description, List<String> methods, List<String> patterns, Map<HttpRequestParameterType, List<FieldDescribe>> parameters, String id) {
        this.name = name;
        this.type = type;
        this.label = label;
        this.description = description;
        this.methods = methods;
        this.patterns = patterns;
        this.parameters = parameters;
        this.id = id;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public ResolvableType getType() {
        return type;
    }

    public void setType(ResolvableType type) {
        this.type = type;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public List<String> getMethods() {
        return methods;
    }

    public void setMethods(List<String> methods) {
        this.methods = methods;
    }

    @Override
    public List<String> getPatterns() {
        return patterns;
    }

    public void setPatterns(List<String> patterns) {
        this.patterns = patterns;
    }

    @Override
    public Map<HttpRequestParameterType, List<FieldDescribe>> getParameters() {
        return parameters;
    }

    public void setParameters(Map<HttpRequestParameterType, List<FieldDescribe>> parameters) {
        this.parameters = parameters;
    }

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
